/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.alphawavesgames.engine.rendering;

import android.graphics.Canvas;
import android.graphics.Color;
import android.text.TextPaint;
import javax.microedition.khronos.opengles.GL10;

/**
 *
 * @author dpsevilyn
 */
public class FontRendererAndroid extends FontRenderer
{
    private Canvas      m_canvas;
    private TextPaint   m_paint;
    private GL10        m_gl;

    public FontRendererAndroid()
    {
        m_canvas = null;
        m_paint = new TextPaint();
        m_paint.setColor(Color.WHITE);
        m_gl = null;
    }

    public void setCanvas( Canvas canvas )
    {
        m_canvas = canvas;
    }

    public void setGL( GL10 gl )
    {
        m_gl = gl;
    }

    @Override
    public void drawText( String text, float xPos, float yPos )
    {
        if( m_canvas != null )
        {
            m_canvas.drawText( text, xPos, yPos, m_paint );
        }
    }

    @Override
    public void setColour( int col )
    {
        m_paint.setColor( col );
    }

}
